import React from 'react';
import CommonPage from '@/components/page/CommonPage';

const daoName = 'CompJgh';
const importName = 'CompJgh';
const columns: API.Column[] = [
  // {
  //   title: '导入结果',
  //   width: 250,
  //   sorter: true,
  //   key: 'DRJG',
  //   dataIndex: 'DRJG',
  //   dispaly: true,
  //   filter: false,
  //   export: false,
  // },
  {
    title: '导入日期',
    width: 120,
    sorter: true,
    key: 'NY',
    dataIndex: 'NY',
    dispaly: true,
    filter: true,
    export: false,
  },
  {
    title: '客户名称',
    width: 250,
    sorter: true,
    dataIndex: 'KHMC',
    key: 'KHMC',
    dispaly: true,
    filter: true,
    export: true,
  },
  {
    title: '是否财政户',
    width: 200,
    sorter: true,
    key: 'ISCZH',
    dataIndex: 'ISCZH',
    dispaly: true,
    filter: false,
    export: false,
  },
  {
    title: '是否机关团体',
    width: 200,
    sorter: true,
    key: 'ISJGTT',
    dataIndex: 'ISJGTT',
    dispaly: true,
    filter: false,
    export: false,
  },
  {
    title: '口径',
    width: 200,
    sorter: true,
    key: 'KJ',
    dataIndex: 'KJ',
    dispaly: true,
    filter: true,
    export: true,
  },
];
const controls: API.Control[] = [
  {
    name: 'NY',
    rules: [
      { required: true, message: '按YYYYMM格式输入,例如:202201' },
      { min: 6, max: 6, message: '长度不能小于6，大于6' },
    ],
    type: 'text',
    label: '日期',
    grid: 12 / 24,
  },
  {
    name: 'KHMC',
    rules: [{ required: true, message: '客户名称不能为空' }],
    type: 'text',
    label: '客户名称',
    grid: 12 / 24,
  },
  {
    name: 'KJ',
    rules: [{ required: true, message: '口径不能为空' }],
    type: 'text',
    label: '口径',
    grid: 12 / 24,
  },
];

const CompJghDrForm: React.FC = () => {
  return (
    <CommonPage
      daoName={daoName}
      columns={columns}
      controls={controls}
      title="公司机构户导入"
      importName={importName}
      importControls={controls}
      importMode="DeleteAfterInsert"
      importParamNames={['NY']}
      importTemplateName="公司机构户导入"
      initSorter={{ FieldName: 'NY', Direction: 'DESC' }}
    />
  );
};

export default CompJghDrForm;
